r = 1 gotcoffee = 1 gotmug = 1 gotwater = 1 gotcoffeemaker = 1 SCREEN 12 COLOR 2, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 5 Seconds = 0 GameTime = Minutes * 60 + Seconds PRINT "" PRINT "" PRINT "After a late night of playing video games and watching reruns of Night Court." PRINT "You wanted to call in sick and not wanting to waste a day just on staying up" PRINT "late. So with no one in sight, you decided why not make yourself a cup of" PRINT "coffee. Maybe this will keep you up long enough until your second wind kicks" PRINT "in. Besides, whats the worse that can happen in making a cup of coffee?" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime DO CLS PRINT PRINT PRINT " " PRINT " /~~~~~~~~/|" PRINT " / /######/ / |" PRINT " / /______/ / |" PRINT " ============ /||" PRINT " |__________|/ || Coffee Simulator" PRINT " |\__,,__/ || Version 1.4" PRINT " | __,,__ || Written by" PRINT " |_\====/%____|| D.B. Taylor" PRINT " | /~~~~\ % / | Copyright (c) 2015" PRINT " _|/ \%_/ |" PRINT "| | | | /" PRINT "|__\______/__|/" PRINT "~~~~~~~~~~~~~~" PRINT "" PRINT "If you are stuck just type HELP." PRINT GOSUB parser LOOP parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK COFFEE" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotwater = 1 THEN: PRINT "A cup cold water." IF gotcoffee = 1 THEN: PRINT "A pouch serving pouch of fine ground up Columbian coffee beans." IF gotcoffeemaker = 1 THEN: PRINT "A single cup coffee maker." IF gotmug = 1 THEN: PRINT "A run of the mill white mug." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "POUR WATER INTO COFFEE MAKER") AND gotwater = 1 AND gotcoffeemaker = 1 THEN CLS PRINT "You pour the cup of water into the coffee maker." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "PUT COFFEE INTO COFFEE MAKER") AND gotcoffee = 1 AND gotcoffeemaker = 1 THEN CLS PRINT "You open the pouch and pour it's contents into the tray." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "PLACE CUP ON TRAY") AND gotmug = 1 AND gotcoffeemaker = 1 THEN CLS PRINT "You place the white mug on the traybe able to reach someone on this thing?" PRINT "But probably not, since no one's around for at least thirty miles or so." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "MAKE COFFEE") AND gotwater = 1 AND gotcoffee = 1 AND gotmug = 1 AND gotcoffeemaker = 1 THEN CLS PRINT "With everything where it's suppose to be, you stand back, and listen as the" PRINT "coffee maker makes you the perfect cup of coffee. The smell fills the room" PRINT "and a sense of excitement overcomes you. It's almost ready..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "DRINK COFFEE") AND gotmug = 1 THEN CLS GOTO win DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing in the break room of where you currently work. Last" PRINT "night, you stayed up way to late playing video games and watching reruns" PRINT "of Night Court, this coffee is going to taste so good." RETURN win: COLOR 2, 0 CLS PRINT "You smell the aroma coming from the cup and as you take this is in." PRINT "You place your lips over the rim and take a sip. Finally the rich" PRINT "taste of the hot coffee begins to wake you up. Finally the start" PRINT "to the perfect day." PRINT PRINT "Thank you for playing." PRINT "Coffee Simulator V1.4" DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "The coffee isn't ready yet, your boss walks in, and looks at you like an" PRINT "idoit. -What, you don't know how to make a cup of coffee? That's it, pack" PRINT "up your things, you are fired.-" PRINT PRINT "Well, now your out of a job and still no coffee. Tough luck..." _DISPLAY END END SUB